package bg.btanev.eightyfour.shared.analytics;

import java.io.Serializable;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 *
 * @author B.Tanev
 *
 */
public abstract class CountingStat implements IsSerializable, Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 58123577855061724L;

	private long total;

	protected CountingStat() {
		super();
	}

	protected CountingStat(long total) {
		super();

		this.total = total;
	}

	public long getTotal() {
		return total;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (total ^ (total >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CountingStat other = (CountingStat) obj;
		if (total != other.total)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "CountingStat [total=" + total + "]";
	}
}
